package com.tskj.leonsu.service.task;

import com.tskj.leonsu.dao.MealsDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.time.LocalTime;

@Component
public class SystemTask {

    @Autowired
    private MealsDAO mealsDAO;

    /**
     * 将菜单、食堂名称、餐段名称等信息放入redis中，方便保存订单用
     * 存储的数据结构：hashmap
     * key：meals
     * item：套餐id
     * value：套餐内容，JsonObject
     */
    public void loadRestaurantToRedis() {
        loadRestaurantToRedisNow();
    }

    public void loadRestaurantToRedisNow() {
//        System.out.println(LocalDateTime.now() + " 开始更新菜单信息");
//        if (mealsDAO.writeFoodListToRedisNow()) {
//            System.out.println(LocalDateTime.now() + " 菜单信息更新成功");
//        }
    }
}
